package com.example.snake;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    public static final String TAG = "MainActivity";
    private Button btnStart;
    private Button btnExit;
    private Button btnRanking;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        initViews();
    }

    private void initViews() {
        btnStart = findViewById(R.id.btnStart);
        btnExit = findViewById(R.id.btnExit);
        btnRanking = findViewById(R.id.btnRanking);
        btnStart.setOnClickListener(v -> {
            startActivity(SnakeGameActivity.class);
        });
        btnExit.setOnClickListener(v -> {
            finish();
        });
        btnRanking.setOnClickListener(v -> {
            startActivity(RankingActivity.class);
        });
    }
    private void startActivity(Class<?> cls) {
        startActivity(new Intent(this, cls));
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}